const fs = require('fs');
const path = require('path');
let file = path.join(__dirname,'test/a.txt');
fs.writeFile(file,'test',(err)=>{
    if(err) {
        throw new Error(err)//Error: Error: ENOENT: no such file or directory, open 'G:\gitosc\node\nodejs\day05\test\a.txt'
    }else {
        console.log('文件创建成功');
    }
});